<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 会员角色临时体验 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\UserSetTemp.name", default="fa_user_set_temp"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\UserSetTemp.poolName"))
 * @DDL(sql="CREATE TABLE `fa_user_set_temp` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `set_id` int(10) NOT NULL DEFAULT '0' COMMENT '变更角色',
  `before` int(10) NOT NULL DEFAULT '0' COMMENT '变更前角色',
  `after` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更后角色',
  `memo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
  `score` decimal(10,2) DEFAULT '0.00' COMMENT '积分',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `end_time` bigint(16) unsigned DEFAULT NULL COMMENT '结束时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='会员角色临时体验'", decode="")
 *
 * @property int|null $id 
 * @property int|null $userId 会员ID
 * @property int|null $setId 变更角色
 * @property int|null $before 变更前角色
 * @property string|float|int|null $after 变更后角色
 * @property string|null $memo 备注
 * @property string|float|int|null $score 积分
 * @property int|null $createtime 创建时间
 * @property int|null $endTime 结束时间
 */
abstract class UserSetTempBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 会员ID.
     * user_id
     * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $userId = 0;

    /**
     * 获取 userId - 会员ID.
     *
     * @return int|null
     */
    public function getUserId(): ?int
    {
        return $this->userId;
    }

    /**
     * 赋值 userId - 会员ID.
     * @param int|null $userId user_id
     * @return static
     */
    public function setUserId($userId)
    {
        $this->userId = null === $userId ? null : (int)$userId;
        return $this;
    }

    /**
     * 变更角色.
     * set_id
     * @Column(name="set_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $setId = 0;

    /**
     * 获取 setId - 变更角色.
     *
     * @return int|null
     */
    public function getSetId(): ?int
    {
        return $this->setId;
    }

    /**
     * 赋值 setId - 变更角色.
     * @param int|null $setId set_id
     * @return static
     */
    public function setSetId($setId)
    {
        $this->setId = null === $setId ? null : (int)$setId;
        return $this;
    }

    /**
     * 变更前角色.
     * before
     * @Column(name="before", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $before = 0;

    /**
     * 获取 before - 变更前角色.
     *
     * @return int|null
     */
    public function getBefore(): ?int
    {
        return $this->before;
    }

    /**
     * 赋值 before - 变更前角色.
     * @param int|null $before before
     * @return static
     */
    public function setBefore($before)
    {
        $this->before = null === $before ? null : (int)$before;
        return $this;
    }

    /**
     * 变更后角色.
     * after
     * @Column(name="after", type="decimal", length=10, accuracy=2, nullable=false, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $after = NULL;

    /**
     * 获取 after - 变更后角色.
     *
     * @return string|float|int|null
     */
    public function getAfter()
    {
        return $this->after;
    }

    /**
     * 赋值 after - 变更后角色.
     * @param string|float|int|null $after after
     * @return static
     */
    public function setAfter($after)
    {
        $this->after = null === $after ? null : $after;
        return $this;
    }

    /**
     * 备注.
     * memo
     * @Column(name="memo", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $memo = '';

    /**
     * 获取 memo - 备注.
     *
     * @return string|null
     */
    public function getMemo(): ?string
    {
        return $this->memo;
    }

    /**
     * 赋值 memo - 备注.
     * @param string|null $memo memo
     * @return static
     */
    public function setMemo($memo)
    {
        $this->memo = null === $memo ? null : (string)$memo;
        return $this;
    }

    /**
     * 积分.
     * score
     * @Column(name="score", type="decimal", length=10, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $score = NULL;

    /**
     * 获取 score - 积分.
     *
     * @return string|float|int|null
     */
    public function getScore()
    {
        return $this->score;
    }

    /**
     * 赋值 score - 积分.
     * @param string|float|int|null $score score
     * @return static
     */
    public function setScore($score)
    {
        $this->score = null === $score ? null : $score;
        return $this;
    }

    /**
     * 创建时间.
     * createtime
     * @Column(name="createtime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 创建时间.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 结束时间.
     * end_time
     * @Column(name="end_time", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $endTime = NULL;

    /**
     * 获取 endTime - 结束时间.
     *
     * @return int|null
     */
    public function getEndTime(): ?int
    {
        return $this->endTime;
    }

    /**
     * 赋值 endTime - 结束时间.
     * @param int|null $endTime end_time
     * @return static
     */
    public function setEndTime($endTime)
    {
        $this->endTime = null === $endTime ? null : (int)$endTime;
        return $this;
    }

}
